<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateExcelQueueTable extends Migration
{
    public function up()
    {
        Schema::create('excel_queue', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->string('queue_name')->unique()->comment('队列名称');
            $table->integer('total_chunk')->default(0)->comment('块大小');
            $table->integer('current_chunk')->default(0)->comment('当前块');
            $table->unsignedInteger('chunk')->default(10000)->comment('块大小 字段相关');
            $table->unsignedTinyInteger('type')->comment('类型 1:导入 :2导出');
            $table->boolean('status')->default(false)->comment('状态');
            $table->string('remarks')->default('')->comment('备注');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('excel_queue');
    }
}
